package com.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.demo.domain.Qco.PageQco;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * @author gxd
 * @since 2025/5/28
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_dict", autoResultMap = true)
@ApiModel(description = "字典表 实体类")
public class SysDict extends PageQco {

    @ApiModelProperty(value = "字典Id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "字典编码")
    @NotEmpty(message = "字典编码不能为空")
    private String code;

    @ApiModelProperty(value = "字典名称")
    @NotEmpty(message = "字典名称不能为空")
    private String name;

    @ApiModelProperty(value = "父级路径")
    private String ancestors;

    @ApiModelProperty(value = "上级编码")
    private String parentCode;

    @ApiModelProperty(value = "上级名称")
    private String parentName;

    @ApiModelProperty(value = "状态（0：停用，1：启用）")
    private Integer status;

    @ApiModelProperty(value = "是否删除（0：正常，1：已删除）")
    private Integer deleted;

    @ApiModelProperty(value = "显示标签")
    private String label;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "子级集合")
    @TableField(exist = false)
    private List<SysDict> childList;
}
